package com.slliver.sentinelservice.openfeign;


import com.slliver.commonmodel.product.Product;
import com.slliver.sentinelservice.openfeign.fallback.ProductFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

@FeignClient(value = "product-service", fallback = ProductFeignClientFallback.class) // 有兜底的回调函数
public interface ProductFeignClient {


    @GetMapping("/product/{productId}")
    Product getProductById(@PathVariable("productId") Long productId, @RequestHeader("token") String token);

}
